<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<div id="center-wrap" class="ui-corner-tl ui-corner-tr">
	<div id="navigation" class="ui-corner-all"><ul><?php echo $navigator;?></ul></div>
	
	<div class="clrboth"></div>
	<?php 
		$ci=& get_instance();
		$USER = $ci->user_entity->init('id',$items->getUserCreatedId());
	?>
	<div class="row">
		<div class="column grid_9">
			<p class="bold"> &raquo; View show:</p>
		</div>
		<div class="clrboth"></div>
		<div class="column grid_9">
			<div class="column grid_2">Show Reference Number:</div>
			<div class="column grid_4">
				<?php echo $items->getRefNo();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Show Name:</div>
			<div class="column grid_4">
				<?php echo $items->getName();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Show type:</div>
			<div class="column grid_4">
				<?php $array = showTypeDataConfig(); echo $array[$items->getShowType()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Duration of show:</div>
			<div class="column grid_4">
				<?php $array = durationOfShowDataConfig(); echo $array[$items->getShowDuration()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Artist:</div>
			<div class="column grid_4">
				<?php echo $items->getArtist();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Country of origin:</div>
			<div class="column grid_4">
				<?php $array = countryOriginDataConfig(); echo $array[$items->getCountryOriginCode()];?>	
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Bid Open To:</div>
			<div class="column grid_6">
				<?php 
					$bid_open_array = array();
					$array = bidOpenToDataConfig();
					foreach(explode(',',$items->getBidType()) as $type){
						$bid_open_array[] = $array[$type] ;
					}
					echo implode(', ',$bid_open_array);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Music Genre:</div>
			<div class="column grid_6">
				<?php 
					$music_genre = array();
					$array = musicGenreDataConfig();
					foreach(explode(',',$items->getMusicGenre()) as $genre){
						$music_genre[] = $array[$genre] ;
					}
					echo implode(', ',$music_genre);
				?>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Speaker Profile:</div>
			<div class="column grid_6">
				<?php 
					$speaker_profile = array();
					$array = speakerProfileDataConfig();
					foreach(explode(',',$items->getSpeakerProfile()) as $profile){
						$speaker_profile[] = $array[$profile] ;
					}
					echo implode(', ',$speaker_profile);
				?>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Plays & Musicals:</div>
			<div class="column grid_6">
				<?php 
					$play_musical = array();
					$array = playsMusicalsDataConfig();
					foreach(explode(',',$items->getPlaysMusicals()) as $p_m){
						$play_musical[] = $array[$p_m] ;
					}
					echo implode(', ',$play_musical);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Period of Travel:</div>
			<div class="column grid_6">
				<?php echo sbxDateFormat($items->getStartDate(),'d/M/Y')." - ".sbxDateFormat($items->getEndDate(),'d/M/Y');?> 
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Bid Due Date:</div>
			<div class="column grid_6">
				<?php echo sbxDateFormat($items->getBidDueDate(),'d/M/Y');?> 
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Booking available for:</div>
			<div class="column grid_6">
				<?php 
					$available_for = array();
					$array = countryZoneDataConfig();
					foreach(explode(',',$items->getAvailableFor()) as $availability){
						$available_for[] = $array[$availability] ;
					}
					echo implode(', ',$available_for);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Entourage Number:</div>
			<div class="column grid_4">
				<?php echo $items->getEntourageNo();?>  PAX
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Min Bid:</div>
			<div class="column grid_4">
				<?php echo $items->getMinBid();?> USD
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Air Travel:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getAirTravel()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Ground:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getGround()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Hotel:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getHotel()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Per diem:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getPerDiem()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Light & Sound:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getLightAndSound()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Rider Requirement:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getRiderReq()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">VISA & Work Permits:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getVisaAndWorkPermits()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Additional Information:</div>
			<div class="column grid_6">
				<?php echo $items->getAdditional();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Upload tech rider:</div>
			<div class="column grid_4">
				<a href="<?php echo fileTarget($USER->getId(),$items->getTechRider());?>" target="_blank"><?php echo $items->getTechRider();?></a>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Upload show images:</div>
			<div class="column grid_6">
				<?php if($items->getShowImage1()):?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getShowImage1());?>" target="_blank">
						<img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage1()),150,150);?>" />
					</a>	
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
				<?php if($items->getShowImage2()):?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getShowImage2());?>" target="_blank">
						<img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage2()),150,150);?>" />
					</a>
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
				<?php if($items->getShowImage3()):?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getShowImage3());?>" target="_blank">
						<img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage3()),150,150);?>" /> 
					</a>
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Upload hospitality rider:</div>
			<div class="column grid_4">
				<?php if($items->getHospitalityRider()): ?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getHospitalityRider());?>" target="_blank"><?php echo $items->getHospitalityRider();?></a>
				<?php endif; ?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Show Status:</div>
			<div class="column grid_6">
				<?php $array = showStatusDataConfig();echo $array[$items->getStatus()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Show Created Date:</div>
			<div class="column grid_6">
				<?php echo sbxDateFormat($items->getCreatedTime(),'d/M/Y');?>
			</div>
			
			<div class="clrboth"></div>
			
			<div style="width:0px;height:20px;"></div>
			
			<div class="column grid_2">
				&nbsp;
			</div>
			<div class="column grid_6">
				<div id="targetBack" class="red"></div>
				<div class="clrboth"></div>
				<?php if($items->getStatus()== "opening"): ?>
					<?php 
						$tmp = howManyDaysCanModifyShowCreated() * 86400 + time();
						if( $tmp > $items->getBidDueDate() ) :
					?>
						<input type="button"  id="button_delete_and_create" name="button_delete_and_create" value="Delete show and create" class="ui-corner-all button-yellow" />
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="button"  id="button_go_back" name="button_go_back" value="No change" class="ui-corner-all button-yellow" />
					<?php else: ?>
						<input type="button"  id="button_edit" name="button_edit" value="Edit show" class="ui-corner-all button-yellow" />
					<?php endif; ?>
				<?php endif; ?>
			</div>
		
			<div class="clrboth"></div>
		</div>
	</div>
	
</form>	
</div>
<div class="clrboth"></div>

<script type="text/javascript">
	$(function() {
		$('#button_go_back').click(function(){
			window.back();
		});
		
		$('#button_delete_and_create').click(function(){
			window.location = BASE_URI+'seller/add_show/cancel_and_create?show_id=<?php echo $items->getId();?>';
		});
		
		$('#button_edit').click(function(){
			window.location = BASE_URI+'seller/show_manage/edit_show?show_id=<?php echo $items->getId();?>';
		});
	});
	
</script>